package demo.standard;

/**
 * The type Director.
 */
public class Director {

    private AbstractBuilder builder;

    public Director(AbstractBuilder builder) {
        this.builder = builder;
    }

    /**
     * 构建仅包含part1的产品.
     */
    public void constructProduct1() {
        builder.buildPart1();
    }

    /**
     * 构建仅包含part2的产品.
     */
    public void constructProduct2() {
        builder.buildPart2();
    }

    /**
     * 构建包含part1+part2的产品.
     */
    public void constructProduct3() {
        builder.buildPart1();
        builder.buildPart2();
    }

}
